package com.hualude.roadsign.controller;

import com.hualude.roadsign.dto.JsonMsgDto;
import com.hualude.roadsign.service.MenuService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by SN on 2017/2/18.
 */
@Controller
@RequestMapping("/rds_menu")
public class MenuController {
    @Resource
    private MenuService menuService;

    @RequestMapping(value = "/getMenuByIds")
    @ResponseBody
    public JsonMsgDto getMenuByIds( String menuIds, Integer userId, Integer orgId, Integer orgType) {
        JsonMsgDto jsonMsgDto = new JsonMsgDto();
        try {
            jsonMsgDto.setJsonData(menuService.getMenuByIds(menuIds, userId, orgId, orgType));
            jsonMsgDto.setIsSuccess(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return jsonMsgDto;
    }
}
